
const {ccclass, property} = cc._decorator;

@ccclass
export default class CommonDialog extends cc.Component {

    params:hy.DialogParams

    public create(params:hy.DialogParams):void {
        this.params = params
        this.node.getChildByName("title").getComponent(cc.Label).string = params.title || "提示"
        this.node.getChildByName("msg").getComponent(cc.Label).string = params.message || "提示信息"
    }

    clickOk() {
        this.params.okCall()
        this.node.destroy()
    }

    clickReject() {
        this.params.rejectCall && this.params.rejectCall()
        this.node.destroy()
    }

    protected onDisable(): void {
        // this.node.destroy()
    }

}
